<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template2.xhtml">

	<ui:define name="content1">
		<f:loadBundle basename="languageSettings.language" var="msg" />
		<h:form id="mainForm">
			<h:selectOneRadio value="#{managerPageBean.menu}"
				valueChangeListener="#{managerPageBean.listener}"
				onchange="submit()">
				<f:selectItem itemValue="User" itemLabel="User" />
				<f:selectItem itemValue="Office Manager" itemLabel="Office Manager" />
			</h:selectOneRadio>

			<f:ajax event="" execute="@this">

				<div class="invertedshiftdown" id="tabContent">
					<ul>
						<!-- Office Manager -->
						<li
							class="#{(managerPageBean.page eq 'manageRequest')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.OM_manager_manageRequests}" immediate="true"
								actionListener="#{managerPageBean.setPage('manageRequest')}"
								rendered="#{managerPageBean.menu eq 'Office Manager'}">
							</h:commandLink></li>
						<li
							class="#{(managerPageBean.page eq 'printerInformation')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.OM_manager_printerInfo}" immediate="true"
								rendered="#{managerPageBean.menu eq 'Office Manager'}">
								<f:actionListener binding="#{printersBean.setMessage('')}" />
								<f:actionListener
									binding="#{managerPageBean.setPage('printerInformation')}"></f:actionListener>
							</h:commandLink></li>
						<li
							class="#{(managerPageBean.page eq 'manageResources')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.OM_manager_manageResources}" immediate="true"
								actionListener="#{managerPageBean.setPage('manageResources')}"
								rendered="#{managerPageBean.menu eq 'Office Manager'}">
							</h:commandLink></li>

						<li
							class="#{(managerPageBean.page eq 'manageUsers')? 'current' : 'nothing'}"><h:commandLink
								rendered="#{managerPageBean.menu eq 'Office Manager'}"
								value="#{msg.OM_manager_manageUsers}"
								actionListener="#{managerPageBean.setPage('manageUsers')}"
								immediate="true">
							</h:commandLink></li>

						<!-- User page -->
						<li
							class="#{(userPageBean.page eq 'requestResources')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.BU_mainUser_menu_reqResources}"
								actionListener="#{userPageBean.setPage('requestResources')}"
								rendered="#{managerPageBean.menu eq 'User'}">
							</h:commandLink></li>
						<li
							class="#{(userPageBean.page eq 'createNotification')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.BU_mainUser_menu_createNotification}"
								rendered="#{managerPageBean.menu eq 'User'}">
								<f:actionListener binding="#{notificationBean.setFeedback('')}" />
								<f:actionListener
									binding="#{userPageBean.setPage('createNotification')}" />

							</h:commandLink></li>
						<li
							class="#{(userPageBean.page eq 'editProfile')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.BU_mainUser_menu_editProfile}"
								actionListener="#{userPageBean.setPage('editProfile')}"
								rendered="#{managerPageBean.menu eq 'User'}" /></li>
						<li
							class="#{(userPageBean.page eq 'editStatus')? 'current' : 'nothing'}"><h:commandLink
								value="#{msg.BU_mainUser_menu_editStatus}"
								actionListener="#{userPageBean.setPage('editStatus')}"
								rendered="#{managerPageBean.menu eq 'User'}" /></li>
					</ul>
				</div>
			</f:ajax>
		</h:form>

		<h:panelGroup id="content1" layout="block"
			rendered="#{managerPageBean.menu == 'Office Manager'}">
			<!-- Office Manager -->
			<h:panelGroup rendered="#{managerPageBean.page == 'manageRequest'}">
				<ui:include src="/manager/request.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'createResponse'}">
				<ui:include src="/manager/responseRequest.xhtml" />
			</h:panelGroup>
			<h:panelGroup
				rendered="#{managerPageBean.page == 'printerInformation'}">
				<ui:include src="/manager/printerReport.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'printerResponse'}">
				<ui:include src="/manager/printerResponse.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'manageResources'}">
				<ui:include src="/manager/resourceCRUD.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'manageUsers'}">
				<ui:include src="/manager/crudusers.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'addUser'}">
				<ui:include src="/manager/newuser.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{managerPageBean.page == 'editUser'}">
				<ui:include src="/manager/editbasicuser.xhtml" />
			</h:panelGroup>
		</h:panelGroup>

		<!-- User -->
		<h:panelGroup id="content2" layout="block"
			rendered="#{managerPageBean.menu == 'User'}">
			<h:panelGroup
				rendered="#{userPageBean.page == 'createNotification' }">
				<ui:include src="/user/createNotification.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{userPageBean.page == 'editProfile'}">
				<ui:include src="/user/editProfile.xhtml" />
			</h:panelGroup>
			<h:panelGroup
				rendered="#{userPageBean.page == 'viewNotificationHistory'}">
				<ui:include src="/user/viewNotificationHistory.xhtml" />
			</h:panelGroup>

			<h:panelGroup rendered="#{userPageBean.page == 'requestResources'}">
				<ui:include src="/user/requestResources.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{userPageBean.page == 'requestHistory'}">
				<ui:include src="/user/requestHistory.xhtml" />
			</h:panelGroup>
			<h:panelGroup rendered="#{userPageBean.page == 'editStatus'}">
				<ui:include src="/user/editStatus.xhtml" />
			</h:panelGroup>
		</h:panelGroup>

	</ui:define>

</ui:composition>
</html>